An inspection device that inspects defects in a mask to be used for photolithography can perform a D-DB (Die to Database) inspection as one of inspection modes. In the D-DB inspection, an optical image of a mask optically detected by a sensor is compared with a reference image generated based on design data of the mask to inspect defects of a pattern formed on the mask.
There are cases where a pattern actually drawn on a mask does not strictly accord with a pattern on design data depending on characteristics of a charged particle beam used for drawing. For example, there is a case where a pattern is drawn with corners of the pattern on design data being rounded. Therefore, an optical image obtained by imaging an actual mask in the D-DB inspection may have a difference from the design data. However, this difference is not a difference caused by a defect of the pattern.
To prevent this difference from being detected as a false defect, a reference image is generated in the D-DB inspection by performing a filter calculation to design data (that is, image data) to approximate the design data to the optical image. In the filter calculation, a filter coefficient that designates a partial region in a mask and enables design data in the designated region to be approximated to an optical image in the designated region is settled. The filter calculation is then performed to the entire design data using the settled filter coefficient.
After the reference image is generated, whether the generated reference image has effectiveness for application to the D-DB inspection (hereinafter, also simply “effectiveness”) is confirmed in the D-DB inspection. To confirm whether the reference image has effectiveness, the reference image is compared with the optical image only in the designated region for which the filter coefficient is settled. The reference image is determined to have effectiveness when a result of the comparison indicates that a difference between the reference image and the optical image is small, and the reference image is determined not to have effectiveness when the difference is large. The D-DB inspection using the reference image is performed when it is confirmed that the reference image has effectiveness, and the D-DB inspection using the reference image is not performed and the filter coefficient is resettled when it is confirmed that the reference image does not have effectiveness.